import React, {Component} from 'react';
import BottomTabNavigator from './bottomTabNavigator'
import {connect} from "react-redux";
import {setMainNavigation} from "../action/actions";

class HomeNavigator extends Component {

    constructor(props) {
        super(props)
    }

    componentDidMount() {
        this.props.dispatch(setMainNavigation(this.props.navigation))
        // BackHandler.addEventListener('hardwareBackPress', ()=>{
        //     if (this.lastBackPressed && this.lastBackPressed + 2000 >= Date.now()) {//按第二次的时候，记录的时间+2000 >= 当前时间就可以退出
        //         BackHandler.exitApp();
        //         return false
        //     }
        //     this.lastBackPressed = Date.now();//按第一次的时候，记录时间
        //     ToastAndroid.show('再按一次退出应用', ToastAndroid.SHORT);//显示提示信息
        //     return true;
        // });
    }

    render() {
        return <BottomTabNavigator/>
    }
}


export default connect()(HomeNavigator)

